<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
function sendEmail($to,$body)
{
    $headers = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    $headers .= 'From: if18068@students.if.itb.ac.id'. "\r\n";
    mail($to,"Konformasi Pendaftaran",$body,$headers);
}

function createActivationCode($email)
{
    $total = $email.date();
    $activationCode = base64_encode($total);
    return $activationCode;
}

function createBody($name,$activationCode)
{
    $body = 'Halo'.$name."<br>";
    $body.='Terima Kasih Telah Melakukan Registrasi'."<br>";
    $body.='Silakan klik Link berikut untuk melakukan aktivasi akun'. "<br>";
    $body.='<a href=\'http://localhost/pollingweb/activate.php?p='.$activationCode.'\'>http://localhost/pollingweb/activate.php?p='.$activationCode."</a>";
    return $body;
}
?>
